﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynamicProperties
{
	/// <summary>
	/// Data class represents dump of one dynamic property.
	/// </summary>
	public class DynamicPropertyDump
	{
		internal static readonly DynamicPropertyDump[] EmptyDumpArray = new DynamicPropertyDump[] { };

		public DynamicPropertyDump(DynamicProperty property, object value)
		{
			this.Property = property;
			this.Value = value;
		}

		/// <summary>
		/// Gets property definition.
		/// </summary>
		public DynamicProperty Property { get; private set; }

		/// <summary>
		/// Gets value of property.
		/// </summary>
		public object Value { get; private set; }

		public override string ToString()
		{
			return string.Format("[{0}] Property '{1}': '{2}' ({3})", 
					this.Property.OwnerType.Name, 
					this.Property.Description, 
					this.Value, 
					this.Property.PropertyType.Name
				);
		}
	}
}
